home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
002
/
chedit.arc
/
EGA.C
< prev
next >
Wrap
Text File
|
1986-07-23
|
2KB
|
54 lines
/*
This program is placed in the public domain by its author, William Couture.
Copyright (c) 1986 by DDI. All Rights Reserved.
*/
void loadega14(shapes1,shapes2,num,offset)
unsigned char *shapes1,*shapes2;
int num,offset;
/* WARNING: This routine is a stack hog!
Make sure that you have AT LEAST 2K of FREE stack before
calling this routine, or the system may CRASH!
*/
/* Num is the number of character shapes to load.
Size is the size of the character in lines.
Offset is the offset into the character shapes to start
loading at. Normally, it is 0 (normal ASCII characters)
or 128 (extended ASCII characters).
Note, however, that loading the any characters will
recalculate the character sizes based on the size of the
characters being loaded. Thus, if you load an 8 x 14 into
the upper characters, you will get an 8 x 14 display in
the lower 128 characters, even if an 8 x 8 character set
is still loaded. */
/* This procedure will combine two CHEDIT character sets into
an 8 x 14 character set for use as an EGA resident character
set (See the chedit documentation for details on the contents
of the character sets). */
{
unsigned char newshape[1792];
int i,j,k,l;
l = 0;
for (i = 0; i < 65; i += 64) /* This is kind of like shuffling a deck */
for (j = 0; j < 32; j++) /* two rows of 32 characters, which */
{ /* start 64 characters apart */
for (k = 0; k < 8; k++) /* upper 8 rows of character */
newshape[l++] = shapes1[(i+j)*8+k];
for (k = 0; k < 6; k++) /* lower 6 rows of character */
newshape[l++] = shapes1[(i+j+32)*8+k];
}
for (i = 0; i < 65; i += 64) /* now do the next set */
for (j = 0; j < 32; j++)
{
for (k = 0; k < 8; k++)
newshape[l++] = shapes2[(i+j)*8+k];
for (k = 0; k < 6; k++)
newshape[l++] = shapes2[(i+j+32)*8+k];
}
loadega(newshape,num,14,offset);
}